﻿using LD.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LD
{
    public partial class FrmSetting : FrmBase
    {
        private ReDrawUI ReDrawUI = new ReDrawUI();
        private FrmSubManager frmsubManager = new FrmSubManager();
        public FrmSetting()
        {
            InitializeComponent();
            FormRegister();
        }
        private void FormRegister()
        {
            MenuLocation ctrlPos = new MenuLocation();
            ctrlPos.Left = 15;
            ctrlPos.Top = 8;
            ctrlPos.Width = 36;
            ctrlPos.Height = 36;
            ctrlPos.Interval = 65;

            frmsubManager.Register("LD.FrmSetting", ctrlPos, this.panel_top, this.panel_center, switchMenu_Click);
        }
        private void switchMenu_Click(object sender, EventArgs e)
        {
            var swBtn = (SwitchMenu)sender;
            if (swBtn.Tag != null)
                frmsubManager.Show(swBtn.Tag.ToString());
        }

        private void FrmSetting_Load(object sender, EventArgs e)
        {
            this.Resize += new EventHandler(FrmSetting_Resize);
            ReDrawUI.ControlInitializeSize(this.panel_top);
        }
        private void FrmSetting_Resize(object sender, EventArgs e)
        {
            ReDrawUI.ControlAutoSize(this.panel_top);
        }
    }
}
